<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width,initial-scale=1.0">
  <link rel="icon" href="<%= BASE_URL %>favicon.ico">
  <title><%= htmlWebpackPlugin.options.title %></title>
</head>

<body>
  <noscript>
    <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled.
      Please enable it to continue.</strong>
  </noscript>
  <div id="app"></div>
  <!-- built files will be auto injected -->
</body>
<script>
  (function (doc, win) {
    var docEl = doc.documentElement,
      resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize',
      recalc = function () {
        //js获取当前的设备大小：document.documentElement.clientWidth;
        var clientWidth = docEl.clientWidth;//获取设备的宽度
        if (!clientWidth) return;
        if (clientWidth >= 1080) {//宽度>750 平板 或者桌面 
          docEl.style.fontSize = '100px';//根元素 
        } else {//移动端的适配 
          //设置：html根元素大小   100设计稿的html大小  750设计稿（根据设计稿变化）
          //测试设计稿大小：测量的值px  px转rem  测量的px/100=?rem  直接css里面写?rem
          docEl.style.fontSize = 100 * (clientWidth / 750) + 'px';
        }
      };
    if (!doc.addEventListener) return;
    win.addEventListener(resizeEvt, recalc, false);
    doc.addEventListener('DOMContentLoaded', recalc, false);
  })(document, window);
</script>

</html>